blob do stringu

Otázka od: hlas

29. 9. 2004 20:50

ako dostanem prvych napr. 6 x 255 znakov
do 6-tich stringov z blobu.

skusam toto ale neviem sa pohybovat po tom blobe
dalej. prvych 255 znakov nacitam.

var
  P: array [0..255] of char;
  bs: TBlobStream;
  hStr: String;
begin
  bs := TBlobStream.Create(Dm.TableZadanZadanie, bmRead);
  FillChar(P,SizeOf(P),#0);
  bs.Read(P, 255);
  hStr := StrPas(P);
  while Pos(#13, hStr) > 0 do {remove carriage returns and}
    hStr[Pos(#13, hStr)] := ' ';
  while Pos(#10, hStr) > 0 do {line feeds}
    hStr[Pos(#10, hStr)] := ' ';
  dm.TableZadanZadanie1.Value:=P;

  bs.Seek(256,0);
  bs.Read(P, 255); hStr := StrPas(P);
  while Pos(#13, hStr) > 0 do {remove carriage returns and}
    hStr[Pos(#13, hStr)] := ' ';
  while Pos(#10, hStr) > 0 do {line feeds}
    hStr[Pos(#10, hStr)] := ' ';
  dm.TableZadanZadanie2.Value:=P;
  bs.Free;
end;